#include "ShoppCart.h"
#include <iostream>

void show()
{
    std::cout << "1.添加商品到购物车\n";
    std::cout << "2.删除商品到回收站\n";
    std::cout << "3.撤销删除的商品\n";
    std::cout << "4.清空购物车\n";
    std::cout << "5.清空回收站\n";
    std::cout << "6.显示购物车商品\n";
    std::cout << "7.显示回收站商品\n";
    std::cout << "8.退出\n";
}

int main()
{
    ShooppCart s;
    while (1)
    {
        system("clear");
        printf("请选择需要执行的功能1-8:\n");
        show();
        int choice = 0;
        std::cin >> choice;
        system("clear");
        switch (choice)
        {
        case 1:
            s.AddGoods();
            break;
        case 2:
            s.DeleteGoods();
            break;
        case 3:
            s.Revokedelet();
            break;
        case 4:
            s.EmptyShopCar();
            break;
        case 5:
            s.EmptyReshopCar();
            break;
        case 6:
            s.ShowShopCar();
            break;
        case 7:
            s.ShowReShopCar();
            break;
        case 8:
            return 0;
        default:
            break;
        }
    }
}
